<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
	xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
<head th:include="inc/home::header">
</head>
<link type="text/css" th:href="@{/css/content.css}" rel="stylesheet" />
<script th:inline="javascript">


	function browseFolder(path) {
		try {
			var Message = "\u8bf7\u9009\u62e9\u6587\u4ef6\u5939"; //选择框提示信息
			var Shell = new ActiveXObject("Shell.Application");
			var Folder = Shell.BrowseForFolder(0, Message, 64, 17); //起始目录为：我的电脑
			//var Folder = Shell.BrowseForFolder(0, Message, 0); //起始目录为：桌面
			if (Folder != null) {
				Folder = Folder.items(); // 返回 FolderItems 对象
				Folder = Folder.item(); // 返回 Folderitem 对象
				Folder = Folder.Path; // 返回路径
				if (Folder.charAt(Folder.length - 1) != "\\") {
					Folder = Folder + "\\";
				}
				document.getElementById(path).value = Folder;
				return Folder;
			}
		} catch (e) {
			alert(e.message);
		}
	}

	/*<![CDATA[*/
	function verifyNull(obj) {

		if (obj == null || obj.val() == "" || obj.val() == "请选择") {
			top.$
					.Zebra_Dialog(
							'<div class="prompt"><div class="warning-icon"></div><div class="success-title">输入的内容不能包含空</div></div>',
							{
								'title' : '提示',
								'buttons' : [ '确定' ]
							});
			return false;
		}
		return true;
	}
	function getData() {
		if (!verifyNull($("#file"))) {
			return false;
		}
		return true;
	}
	function Save() {
		var path = $("#path").val();//.replace(/\\/g, "/");
		if (path != null && path != "") {
			$.post("/backUp", {
				path : path
			}, function(data) {
				if(data=="success")
				{
					alert("成功备份数据")
				}
			});
		}
	}

	/*]]>*/
</script>

<body>
	<!--返回-->
	<div class="back" onclick="loadPage('/data-clean')">
		<img src="images/back.png" />
	</div>
	<div class="head-top">
		<div th:include="header :: header"></div>
	</div>
	<div class="header-title">
		<span>数据库操作</span>
	</div>
	<div class="spare-a">
		<div class="save-bg">
			<a href="javascript:void(0)" class="spare-tj" onClick="Save()">确定</a>
		</div>
		<div class="spare-add">
			<ul>
				<li>
					<div class="spare-addl">文件：</div>
					<div class="spare-addr">
						<form name="form" method="post" action="">
							<input type="text" id="path" name="path" class="spare-add-input" />
							<input type="button" value="浏览"
								onClick="browseFolder('path')" class="uploadfile" />
						</form>
					</div>
				</li>
			</ul>
		</div>
	</div>
</body>
</html>
